# Maintainer: Dan Printzell <wild@archlinux.org>
# Maintainer: Filipe Laíns (FFY00) <lains@archlinux.org>
# Contributor: Severen Redwood <severen@shrike.me>
# Contributor: Robert Welin <robert.welin@gmail.com>
# Contributorr: dsboger <https://github.com/dsboger>

pkgname=gtkd
pkgver=3.10.0
pkgrel=10
pkgdesc='D bindings for GTK+ and related libraries.'
arch=('loong64' 'x86_64')
url='https://gtkd.org'
license=('LGPL')
depends=('liblphobos' 'gtk3')
makedepends=('ldc')
optdepends=('pango' 'atk' 'gdk-pixbuf2' 'gtksourceview3' 'gstreamer' 'vte3' 'libpeas')
source=("GtkD-$pkgver.tar.gz::https://github.com/gtkd-developers/GtkD/archive/v$pkgver.tar.gz")
sha512sums=('1e75d6cbd278a065ce26b33320fe06cc7a30af8bd884c3c87abe799afaf9da8339d3c4470163b62ec8b70e8c540285b8c2c409c7b77423142a301f23ba37ff2e')

build() {
    cd GtkD-$pkgver
		export _ldFlags="$(echo -ne $LDFLAGS | sed -e 's/ /,/g')"

    make \
        DC='ldc' \
        LDFLAGS="-L=\"$_ldFlags\"" \
        libdir='lib/' \
        shared-{gtkd,gtkdgl,sv,gstreamer,vte,peas}
}

check() {
    cd GtkD-$pkgver

    make LDFLAGS='' test
}

package() {
    cd GtkD-$pkgver

    make \
        prefix='/usr' \
        libdir='lib/' \
        DESTDIR="$pkgdir" \
        install-{shared,headers}-{gtkd,gtkdgl,gtkdsv,gstreamer,vte,peas}
}
